/**
 * @name Router
 * @desc 页面路由配置
 */

import React, {Component} from 'react'
import {Switch, Route, Redirect, Link} from 'react-router-dom'
import Home from './pages/Home'
import FunctionTypeComponent from './pages/FunctionTypeComponent'
import NotFoundPage from './pages/NotFoundPage'

import {CacheRoute, CacheSwitch} from 'react-router-cache-route'
import Nav from "./components/Nav";

class Router extends Component {
    render() {
        return (
            <>

                {/*<Nav />*/}
                <Switch>
                    {/*    <CacheSwitch>*/}
                    <Route path="/" to="/home" exact component={Home}/>
                    <Route path="/funcType" exact component={FunctionTypeComponent}/>

                    {/* 404 */}
                    <Route path='/404' component={NotFoundPage}/>
                    {/* 其他重定向到 404 */}
                    <Redirect from='*' to='/404'/>
                    {/*</CacheSwitch>*/}

                </Switch>

            </>
        )
    }
}

export default Router